﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<%@page import="java.io.InputStream"%>
<%@page import="org.apache.ibatis.io.Resources"%>
<%@page import="org.apache.ibatis.session.SqlSessionFactory"%>
<%@page import="org.apache.ibatis.session.SqlSession"%>
<%@page import="java.io.IOException"%>
<%@page import="org.apache.ibatis.session.SqlSessionFactoryBuilder"%>
<%@page import="util.Info"%>
<%@page import="dao.CommDAO"%>
<%@page import="util.PageManager"%>
  <%
HashMap user = Info.getUser(request);
String uname = user.get("uname").toString();
String utype = user.get("utype").toString();
String userid = user.get("id").toString();
 %>
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="桌面壁纸网站 - Clean HTML5 and CSS3 responsive template">
<meta name="author" content="MyPassion">

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

<title>桌面壁纸网站 - Responsive HTML5 and CSS3 template</title>

<link rel="shortcut icon" href="img/sms-4.ico" />

<!-- STYLES -->
<link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/superfish.css" media="screen"/>
<link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/fontello/fontello.css" />
<link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/flexslider.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/ui.css" />
<link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/base.css" />
<link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/style.css" />
<link rel="stylesheet" type="text/css" href="/wallpaper/frontfiles/css/960.css" /> 
 
<!--[if lt IE 9]> <script type="text/javascript" src="/wallpaper/frontfiles/js/customM.js"></script> <![endif]-->

 

</head>

<body>

<!-- Body Wrapper -->
<div class="body-wrapper">
	<div class="controller">
    <div class="controller2">

        <jsp:include page="../top.jsp"></jsp:include>
        
       
         <form name="f1"  action="messagescx.jsp"  method="post" style="display: inline;font-size: 14px">
            <center>
                	<table align="center"  class="table1"  width="99%" style="margin-top:0px;">
                    
                    <thead>
							<tr>
                            	<td height="32" style="background-color: #fafafa" colspan="20"  align="left">
<font style="font-size: 15px;color: #EB5253">&nbsp;&nbsp;您当前的位置 : 留言管理</font></td> 
                            </tr>
					  </thead>
                    
                     
                             <tr>
                            	<td colspan=6 height="36" align="left">  &nbsp;
<% 
String puname = request.getParameter("uname")==null?"":request.getParameter("uname"); 
String pcont = request.getParameter("cont")==null?"":request.getParameter("cont"); 
String startsavetime = request.getParameter("startsavetime")==null?"":request.getParameter("startsavetime"); 
String endsavetime = request.getParameter("endsavetime")==null?"":request.getParameter("endsavetime"); 
   %>

<%
 HashMap mmm = new HashMap();%> 

&nbsp;
留言人 
: 
<input type=text class=''  size=20 name='uname' />
&nbsp;

&nbsp;
内容 
: 
<input type=text class=''  size=20 name='cont' />
&nbsp;

&nbsp;
留言时间 :
 
<input type=text class=''  size=10 name='startsavetime' onclick='WdatePicker();' />
&nbsp;至&nbsp;

<input type=text class=''  size=10 name='endsavetime' onclick='WdatePicker();' />
&nbsp;

<input type=submit class='' value='查询信息' /> </td>
                            </tr>
						 
							<tr>
                            	<td height="30" align="center">留言人</td>
<td height="30" align="center">内容</td>
<td height="30" align="center">回复</td>
<td height="30" align="center">留言时间</td>
<td height="30" align="center">操作</td>
                            </tr>
						 
						 
							<% 
new CommDAO().delete(request,"messages"); 
if(request.getParameter("unameid1")!=null){ 
 new CommDAO().commOper("update messages set uname ='' where id="+request.getParameter("unameid1"));  
} 
if(request.getParameter("unameid2")!=null){ 
 new CommDAO().commOper("update messages set uname ='' where id="+request.getParameter("unameid2"));  
} 
HashMap<String,String> selectmap = new HashMap();
HashMap<String,String> selectymap = new HashMap();
HashMap<String,String> selectbmap = new HashMap();
 selectmap.put("uname","");  
 selectmap.put("cont","");  
 if(!startsavetime.equals("")){  
 selectbmap.put("startsavetime",">=");  
 mmm.put("startsavetime",startsavetime);  
 }  
 if(!endsavetime.equals("")){  
 selectbmap.put("endsavetime","<=");  
 mmm.put("endsavetime",endsavetime);  
 }  
String sql = Info.selectBuild3("messages",selectmap,selectymap,selectbmap,request) ;
String url = "messagescx.jsp?1=1&uname="+puname+"&cont="+pcont+"&savetime="+startsavetime+"&savetime="+endsavetime+""; 
ArrayList<HashMap> list = PageManager.getPages(url,5, sql, request ); 
for(HashMap map:list){ %>
<tr>

                            	<td height="30" align="center"><%=map.get("uname")%></td>
                            	<td height="30" align="center"><%=map.get("cont")%></td>
                            	<td height="30" align="center"><%=map.get("recont")%></td>
                            	<td height="30" align="center"><%=map.get("savetime")%></td>
                            	<td height="30" align="center">
<a href="messagesxg.jsp?id=<%=map.get("id")%>">回复</a>
&nbsp;|&nbsp;

<a onclick="return confirm('确定要删除这条记录吗?')" href="messagescx.jsp?scid=<%=map.get("id")%>">删除</a>
</td>
</tr>
<%}%>
                            
                            
                            <tr>
                            	<td colspan=6 height="33" align="center">${page.info}</td>
                            </tr>
						 
					</table>
  </center>
 </form>
           
        <jsp:include page="../foot.jsp"></jsp:include>
        
        
         
    
    </div>
	</div>
</div>
<!-- / Body Wrapper -->


<!-- SCRIPTS -->
<script type="text/javascript" src="/wallpaper/frontfiles/js/jquery.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/easing.min.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/1.8.2.min.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/ui.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/carouFredSel.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/superfish.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/customM.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/flexslider-min.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/tweetable.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/timeago.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/jflickrfeed.min.js"></script>
<script type="text/javascript" src="/wallpaper/frontfiles/js/mobilemenu.js"></script>

<!--[if lt IE 9]> <script type="text/javascript" src="/wallpaper/frontfiles/js/html5.js"></script> <![endif]-->
<script type="text/javascript" src="/wallpaper/frontfiles/js/mypassion.js"></script>


</body>
</html>
 
<script type="text/javascript">
<%
if(session.getAttribute("suc")!=null)
{
session.removeAttribute("suc");
%>
alert("操作成功"); 
<%}
%>
</script>
            <script language=javascript src='/wallpaper/js/ajax.js'></script>
<% 
mmm.put("uname",puname); 
mmm.put("cont",pcont); 
mmm.put("savetime",startsavetime); 
mmm.put("savetime",endsavetime); 
%>
<%=Info.tform(mmm)%> 
<script language=javascript >  
 
</script>  
<%=Info.tform(mmm)%> 
<script language=javascript src='/wallpaper/js/My97DatePicker/WdatePicker.js'></script>
<script language=javascript src='/wallpaper/js/popup.js'></script>
<script language=javascript> 
function update(no){ 
pop('messagesxg.jsp?id='+no,'信息修改',550,'100%') 
}
</script> 
<script language=javascript> 
function add(){ 
pop('messagestj.jsp','信息添加',550,'100%') 
}
</script> 
<%@page import="util.Info"%> 
<%@page import="java.util.ArrayList"%> 
<%@page import="java.util.HashMap"%> 
<%@page import="util.PageManager"%> 
<%@page import="dao.CommDAO"%> 
